import { createRouter, createWebHistory } from 'vue-router'
import home from '../views/home/index.vue'
import search from '../views/search/index.vue'


import cla from '../views/home/children/cla.vue'
import indes from '../views/home/children/indes.vue'
import shop from '../views/home/children/shop.vue'
import my from '../views/home/children/my.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '',
      redirect:'/home/indes',
    },
    {
      path: '/search',
      name: 'search',
      component: search,
    },
    {
      path: '/home',
      name: 'home',
      component: home,
      children: [
        {
          path: 'indes',
          name: 'indes',
          component: indes,
        },
        {
          path: 'cla',
          name: 'cla',
          component: cla,
        },
        {
          path: 'shop',
          name: 'shop',
          component: shop,
        },
        {
          path: 'my',
          name: 'my',
          component: my,
        },
      ]
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
  ],
})

export default router
